package cn.stylefeng.guns.modular.business.custom.enums;

public enum TransportWayEnum {

    GONGLUYUNSHU(1, "公路运输"),
    TIELUYUNSHU(2, "铁路运输");

    TransportWayEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int type;

    public String desc;

    public static boolean valid(Integer type) {
        if (type == null) {
            return false;
        }
        TransportWayEnum[] pts = TransportWayEnum.values();
        for (TransportWayEnum pt : pts) {
            if (type == pt.type) {
                return true;
            }
        }
        return false;
    }

    public static String getValue(Integer type) {
        if (type == null) {
            return "";
        }
        TransportWayEnum[] pts = TransportWayEnum.values();
        for (TransportWayEnum pt : pts) {
            if (type == pt.type) {
                return pt.desc;
            }
        }
        return "";
    }
}
